home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / tspa3155.zip / TSUNTF.INT < prev    next >
Text File  |  1992-09-20  |  4KB  |  103 lines

  1. {$B-,F-,I+,N-,V+}
  2. {$S+}
  3. {$R-}
  4. {$D-}
  5.  
  6. (*
  7. Timo Salmi UNiT F
  8. A Turbo Pascal unit for readln with string editing, "Editable Readln"
  9. All rights reserved 19-Aug-89
  10. Updated 4-Sep-89, 24-Sep-89, 21-Mar-90, 14-Jun-90, 20-Sep-92
  11.  
  12. TSUNTF first appeared in release TSPAS13 of my Turbo Pascal units package.
  13.  
  14. This unit may be used and distributed freely for PRIVATE, NON-COMMERCIAL,
  15. NON-INSTITUTIONAL purposes, provided it is not changed in any way. For
  16. ANY other usage, such as use in a business enterprise or a university,
  17. contact the author for the terms of registration.
  18.  
  19. The units are under development. Comments and contacts are solicited. If
  20. you have any questions, please do not hesitate to use electronic mail for
  21. communication.
  22. InterNet address: ts@chyde.uwasa.fi         (preferred)
  23. Bitnet address:   SALMI@FINFUN
  24.  
  25. The author shall not be liable to the user for any direct, indirect or
  26. consequential loss arising from the use of, or inability to use, any unit,
  27. program or file howsoever caused. No warranty is given that the units and
  28. programs will work under all circumstances.
  29.  
  30. Timo Salmi
  31. Professor of Accounting and Business Finance
  32. Faculty of Accounting & Industrial Management; University of Vaasa
  33. P.O. BOX 297, SF-65101 Vaasa, Finland
  34. *)
  35.  
  36. unit TSUNTF;
  37.  
  38. (* ======================================================================= *)
  39.                           interface
  40. (* ======================================================================= *)
  41.  
  42. uses Dos,
  43.      Crt;
  44.  
  45. (* =======================================================================
  46.               The basic three editable readln routines
  47.    ======================================================================= *)
  48.  
  49. (* An enhanced readln with the possibility of editing input strings
  50.    using insert mode
  51.      The functional edit keys are
  52.        BackSpace
  53.        Del
  54.        CursorLeft
  55.        CursorRight
  56.        Home
  57.        End
  58.        Esc *)
  59. procedure EDRDLN (prompt : string; var InputString : string);
  60.  
  61. (* This version gives the possibility of recalling a string by pressing
  62.    the CursorUp key. Insert key is also functional *)
  63. procedure EDREADLN (prompt          : string;
  64.                     RecallString    : string;
  65.                     var InputString : string);
  66.  
  67. (* This is the most versatile of the enhanced readln. It has the same
  68.    characteristics as EDRDLN and EDREADLN, plus it detects whether the
  69.    break has been pressed. Furthermore, the maximum witdth of the screen
  70.    is given as a parameter (MaxLength) which is very useful if you
  71.    application makes windows.
  72. *)
  73. procedure EDREABLN (Prompt           : string;
  74.                     RecallString     : string;
  75.                     MaxLength        : integer;
  76.                     var InputString  : string;
  77.                     var BreakPressed : boolean);
  78.  
  79. (* =======================================================================
  80.      The editable readln routines versions with the pre-fill option
  81.    ======================================================================= *)
  82.  
  83. (* Same as EDREADLN, but with the pre-fill option available
  84.    Important, you must always assign a value to the PrefillString
  85.    before invoking this routine. Else you will have a random default
  86.    with unexpected results *)
  87. procedure EDRDEFLN (prompt          : string;
  88.                     RecallString    : string;
  89.                     PrefillString   : string;
  90.                     var InputString : string);
  91.  
  92. (* Same as EDREABLN, but with the pre-fill option available
  93.    Important, you must always assign a value to the PrefillString
  94.    before invoking this routine. Else you will have a random default
  95.    with unexpected results *)
  96. procedure EDRDEBLN (Prompt           : string;
  97.                     RecallString     : string;
  98.                     PrefillString    : string;
  99.                     MaxLength        : integer;
  100.                     var InputString  : string;
  101.                     var BreakPressed : boolean);
  102.  
  103.